package com.example.demo.controller;

import com.example.demo.service.DashboardService;
import com.example.demo.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController()
@RequestMapping("/dashboard")
public class DashboardController {
    @Resource
    private DashboardService dashboardService;

    @RequestMapping(value = "/selectRoomNumber", method = RequestMethod.GET)
    public Result selectRoomNumber(){
        return dashboardService.selectRoomNumber();
    }

    @RequestMapping(value = "/selectLiveNumber", method = RequestMethod.GET)
    public Result selectLiveNumber(){
        return dashboardService.selectLiveNumber();
    }

    @RequestMapping(value = "/selectRevenue", method = RequestMethod.GET)
    public Result selectRevenue(String month){
        return dashboardService.selectRevenue(month);
    }

    @RequestMapping(value = "/selectRevenueByMonth", method = RequestMethod.GET)
    public Result selectRevenueByMonth(String month){
        return dashboardService.selectRevenueByMonth(month);
    }
}
